DevTool Custom Component Scenario

The MAX Development Tool is able to generate Visual Studio Projects and Solutions from scratch that automatically link into SOLIS as DLLs. As part of this example scenario, a DevTool Project "CustomComponent" has been started for you. Once you walk through the example project, you should have the knowledge you need to start building any custom logic you desire.

Opening the SOLIS Scenario
  1. Open the SOLISExample_DevToolCustomComponent.sc file and go to the Development Tool page in SOLIS. In the Scenario DLL List there is a CustomComponent.DLL.
  2. Click DevTool Start Button at the top of the page.
  3. Modify the DevTool UI settings as shown below with the Base Directory at C:\ProgramData\AGI\STK 12\SOLIS\ExampleScenarios\SOLISExample_DevToolCustomComponent\CustomComponent.

    DevTool UI

  4. Once your settings are updated, go to the File menu and select "Save as Batch File" DevTool Save Batch Button to create C:\ProgramData\AGI\STK 12\SOLIS\ExampleScenarios\SOLISExample\_DevToolCustomComponent\RunDevTool.bat.
From here on, you can simply run this Batch file to run the DevTool for this project.
Opening the VS CustomComponent Solution

The MAX Development Tool interprets XML files from the xml directory of your project using an XML Schema. The Schema will guide you in writing valid syntax. Let's explore the CustomComponent Project by opening the C:\ProgramData\AGI\STK 12\SOLIS\ExampleScenarios\SOLISExample_DevToolCustomComponent\CustomComponent\CustomComponent.sln file in Visual Studio 2017.

Be sure the "Desktop development with C++" option is installed in Visual Studio.

Visual Studio Install Options

Understanding the CustomComponent XML File

Look at the Custom Component solution below. In the CustomComponentXML.xml, some lines (after line 25) have already been created and run through the DevTool. This file is what the DevTool interprets to build the C++ code. From there, you add logic to your C++ code.

The DevTool produces *.auto.hpp, *.auto.cpp, *.hpp, and *.cpp files. The *.auto.* files are NOT to be edited by the user. User code goes in the nonauto files. The DevTool will not clobber user-written code in the nonauto files.

Visual Studio Solution

The file is broken down as such:

Line Sections Details
18-24 This section defines a File Header Text that will be placed at the top of your files upon generation of those files. Once the file has been generated, the Header Text will not change.
26-36 These lines define a Namespace where common Constants, Structures, Enumerations, etc. can be stored and referenced throughout the project. In this example, there is a defined enumeration and structure.
37-42 These lines define an interface that is used to pass/grab data between Components in the system. In this case, the interface contains four properties.
44-56 These lines define the Component that produces the ODY_Disturbance (defined in the ADCS XML) and the MyInterface interfaces. It also connects to/gets data from a FSW_Ephemeris and FSW_AttDetermination interface. There are two parameters (V_ConstantDisturbance_Nm and E_MyEnum) in this Component, which you can set via the Configuration Manager or in configuration files. Lastly, the Component is producing telemetry of a torque VECTOR.

Interface File

Writing the Logic
For detailed DevTool information see MAX DevTool XML Guide

Even in the CustomDisturbance.cpp file, the DevTool manages a large portion of the required syntax. It is simply up to you to write the logic within the function stubs.

Start with the functions at the end of the file, shown below. There are four functions visible with a "From interface:" comment above them. These items implement what this component returns when another component requests, for example, GetTorque_BDY_Nm(). The only portion that was manually written was the return m_Tlm.MyTorque_Nm; statement.

Component File

Now looking above at the Iterate() function. This is where the bulk of the custom logic was written. The example is intentionally generic but does prove the necessary points to get started. Here, we have grabbed data from another component (FSW_Ephemeris) using the m_Connection structure. That data is then used to create a sinusoidal torque which is pushed into the telemetry, m_Tlm, variable.

Useful Structures to Know

Structure Description
m_Connection The connections from other interfaces
m_Parm The parameters that you've specified for this component
m_Tlm The telemetry that you've specified for this component
m_Data (Optional) See "GeneratePropertyDataStructure" in the MAX DevTool XML Guide

At this point, there is some logic that can produce a custom torque. Now it's time to configure this into the system.

Configuring to Use Custom Disturbance Component

Before you go any further, open the SOLISExample_DevToolCustomComponent.sc file and go to the SOLIS Development Tool page. Ensure that the Scenario DLL List contains a CustomComponent.DLL. To verify this is working, rebuild your CustomComponent.sln solution. Then click Refresh Windows on the Development Tool page.

Each time you compile your CustomComponent.sln project, you should see the timestamp on this DLL update.

In your SOLIS scenario, go to the Configuration Manager page. This is where you will configure the system to build, use, and connect the new "CustomDisturbance" Component. This scenario has the following steps completed, but here are the steps to walk through them:

Step 1: Create a custom Configuration Set

Custom Config Set

Step 2: Add an instance of the CustomDisturbance to the CustomConfigSet

Add Component

Step 3: Configure the CustomDisturbance to have it's connections and parameters

Configure Component

Step 4: Create a custom Version of ODY_EquationsOfMotion

Custom EOM

Step 5: Add a Disturbance connection to the ODY_EquationsOfMotion from the new CustomDisturbance

Add Disturbance

Step 6: Set the CustomConfigSet as the Configuration Set to run

Set Configuration

Running the new setup

With the "CustomConfigSet" selected, you should now notice a "Custom" Group on the Telemetry page. This is coming from your new CustomDisturbance! Go ahead and Run the Simulation.

Custom Component Telemetry

Below you can see the torques and momentum getting into the system. If you take a quick look at the logic in the Iterate() section, you are creating torque until the Body Rates get above 5 deg/s. You can see the logic (though unusual) is working perfectly. That should be enough to get you started playing around. The possibilities are endless. Enjoy!

Results

The Custom Development Process

Custom Development Process